/*
* 存入数据库
* */
var mongoose = require('mongoose');
require('./model.js');

var Book = mongoose.model('Book');

var book = new Book({
	"name": "cc-db",
	"author": "cc",
	"publishTime": new Date()
})

// 存入数据库
book.save(function(err) {
	err ? console.log('err:'+err): console.log('success')
})


Book.find({},function(err,doc) {
	if(err) console.log('err:',err);
	console.log('doc',doc)
})